<template>
    <div>
        <button @click="btn">最畅销</button>
        <button @click="btt">最有钱</button>
        <table>
            <tr v-for="i in list" :key="i.id">
                <td>{{i.price}}</td>
            </tr>
            <tr>
                <td>开始时间</td>
                <td>结束时间</td>
                <td>花费</td>
            </tr>
            <tr v-for="i in list_" :key="i.id">
                <td>{{i.start}}</td>
                <td>{{i.end}}</td>
                <td>{{i.money}}</td>
            </tr>
        </table>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data () {
        return {
            list:[],
            list_:[]
        }
    },
    created () {
        axios.get('http://127.0.0.1:8000/user/boss/').then((res)=>{
            this.list = res.data
        }),
        axios.get('http://127.0.0.1:8000/user/start/').then((res)=>{
            this.list_ = res.data
        })
    },
    methods: {
        // btn(){
        //     axios.get('http://127.0.0.1:8000/user/sou1/?id+'=this.id).then((res)=>{
        //         alert(res.data.msg)
        //     })
        // },
        // btt(){
        //     axios.get('http://127.0.0.1:8000/user/sou2/?id+'=this.id).then((res)=>{
        //         alert(res.data.msg)
        //     })
        // }
    }
}
</script>

<style>

</style>